package com.hangxintong.common.base.service;

import com.hangxintong.common.base.entity.BaseJpaRepository;
import com.hangxintong.common.base.entity.LmUser;
import com.hangxintong.common.base.entity.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService extends BaseJpaService<LmUser> {

    @Autowired
    private UserRepository repository;

    @Override
    protected BaseJpaRepository<LmUser> getRepository() {
        return repository;
    }

    public LmUser findByMobile(String mobile){
        return repository.findByMobile(mobile);
    }

    public int queryByMobile(String phone) {
        return  repository.countByMobile(phone);
    }

    public LmUser findByOpenId(String openId) {
        return repository.findByOpenId(openId);
    }
}
